<?php
/**
 * 车辆验证类
 * @Author    紫梦
 * @DateTime  2017-11-21
 * @copyright 响响租车
 * @version   1.0
 */
namespace app\common\validate;

use think\Validate;

class Cars extends Validate
{
    protected $rule = [
        
        'car_unique_id'  =>  'unique:cars|require',
        
        'sim_id'  =>  'unique:cars',
        'equipment_id'  =>  'unique:cars',
       
    ];
    
    protected $message = [
        
        'car_unique_id.require'  =>  '车架号必须',

        'car_unique_id.unique'  =>  '车架号已经存在',
        'sim_id.unique'  =>  'SIM号已经存在',
        'equipment_id.unique'  =>  '车载智能设备号已经存在',
       
    ];
    
    protected $scene = [
        'add'   =>  ['car_unique_id','sim_id','equipment_id'],
        'edit'  =>  ['car_unique_id','sim_id','equipment_id'],
    ]; 
  
}